//
//  FH_NSUserDefaultsSave.m
//  funChat
//
//  Created by fanruoyang on 2018/2/2.
//  Copyright © 2018年 biyingkeji. All rights reserved.
//

#import "WRNSUserDefaultsSave.h"

@implementation WRNSUserDefaultsSave

+(void)saveInformation:(id)information forKey:(NSString *)key{
    
    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
    [defaults setValue:information forKey:key];
    [defaults synchronize];
}

//轻量获取本地数据
+(id)getFriendInformation:(NSString *)key{
    
    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
    if (key) {
        id value = [defaults objectForKey:key];
        if (value) {
           return value;
        }
    }
    return nil;
}

//删除本地轻量数据
+(void)removeFriendInformationForKey:(NSString *)key{
    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
    [defaults removeObjectForKey:key];
    [defaults synchronize];
}

@end
